package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.OverflowList;
import com.atguigu.jxc.service.OverflowListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
@RequestMapping("overflowListGoods")
public class OverflowListGoodsController {

    @Autowired
    private OverflowListService overflowListService;

    @PostMapping("/save")
    @ResponseBody
    public ServiceVO save(OverflowList overflowList, String overflowListGoodsStr, HttpSession session){
        return overflowListService.save(overflowList,overflowListGoodsStr,session);
    }

    @PostMapping("/list")
    @ResponseBody
    public Map<String,Object>  list(String  sTime,String  eTime){
        return overflowListService.list(sTime,eTime);
    }

    @PostMapping("/goodsList")
    @ResponseBody
    public Map<String,Object> goodsList(Integer overflowListId){
        return overflowListService.goodList(overflowListId);
    }
}
